<include file="Common:header" />
<style type="text/css">
#content{height:auto!important; overflow:hidden;height: auto; width:120%; }
#content #APIHy{ height:50px; margin-top:50px; margin-left:40px;}
#APIHy div{ float:left; line-height:50px; vertical-align:middle; font-size:24px; font-weight:bold;}
#content #S_l,#content #S_r{ float:left; margin-left:40px;_margin-left:20px; padding-top:15px; font-size:16px; width:380px;_width:370px; line-height:20px; padding-bottom:40px; }
#content #S_l{ border-right:2px solid #DDD;}
.APItem{ clear:both; margin-top:25px; _margin-top:15px;height:30px;}
.apitext{ border:1px solid #ddd; width:220px; height:30px; font-size:24px;}
.Itemleft{ clear:both; float:left; text-align:right; padding-right:10px; width:110px;_width:90px; height:30px; line-height:30px; vertical-align:middle;}
.ItemRight{ float:left; text-align:left; height:30px;}
</style>
<div id="content" class="c">
    <div id="APIHy"><div><img src="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.head}>/100<else/><{$baseinfo.profile_image_url}></if>" width="50" height="50" /></div><div>&nbsp;<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.nick}><else/><{$baseinfo.screen_name}></if>, 欢迎来到游子E</div></div>
    <div id="S_l">第一次来游子E？请补充资料，完成游子E网注册：<br/><span style=" font-size:12px; color:#279C27">为了方便体验我们的后续服务，请完成免激活注册</span><br/>
        <input type="hidden" name="SinaUserName" id="SinaUserName" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.nick}><else/><{$baseinfo.screen_name}></if>" />
        <input type="hidden" name="SinaUserImgUrl" id="SinaUserImgUrl" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.head}>/100<else/><{$baseinfo.profile_image_url}></if>" />
        <input type="hidden" name="SinaUserID" id="SinaUserID" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.name}><else/><{$baseinfo.id}></if>" />
        <input type="hidden" name="SinaUserAbout" id="SinaUserAbout" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.introduction}><else/><{$baseinfo.description}></if>" />
         <input type="hidden" name="mailCheck" id="mailCheck" value="0" />
         <input type="hidden" name="nameCheck" id="nameCheck" value="0" />
         <input type="hidden" name="APIType" id="APIType" value="<{@apiType}>" />
       <div class="APItem"><div class="Itemleft">用户名</div><div class="ItemRight"><input class="apitext" name="username" maxlength="16" id="username" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.name}><else/><{$baseinfo.name}></if>" type="text"  /><br/><span id="check1" class="divdisplay" style="color:#ff0000"></span></div></div>
        <div class="APItem"><div class="Itemleft">Email</div><div class="ItemRight"><input class="apitext" name="mailadres" id="mailadres" type="text" maxlength="25" /><br/><span id="check2" class="divdisplay" style="color:#ff0000"></span></div></div>
        <div class="APItem"><div class="Itemleft">密码</div><div class="ItemRight"><input class="apitext" name="password1" id="password1" type="password" onpaste="return false;"/><br/><span id="check3" class="divdisplay"></span></div></div>
        <div class="APItem"><div class="Itemleft">确认密码</div><div class="ItemRight"><input class="apitext" name="password2" id="password2" type="password" /><br/><span id="check4" class="divdisplay"></span></div></div>
        <div class="APItem"><div class="Itemleft"></div><div class="ItemRight"><input type="checkbox" value="1" id="CheckItem" name="CheckItem" />我已阅读并同意<a href="<{:SITE_URL}>/Index/serviceitem" target="_blank">服务条款</a></div></div>
        <div class="APItem" style=" margin-top:0px;"><div class="Itemleft"></div><div class="ItemRight"><img src="<{:__PUBLIC__}>/images/sinaapij.jpg" onclick="check_register();" style=" cursor:pointer;" /></div></div>
    </div>
    <div id="S_r" style="_margin-left:40px;">已经在游子E注册过？请输入游子E网账号进行绑定：<br/><br/>
        <form action="<{:SITE_URL}>/Index/dologinbind" name="formbind" id="formbind" method="post">
        <input type="hidden" name="APIType" value="<{@apiType}>" />
        <input type="hidden" name="SinaUserName" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.nick}><else/><{$baseinfo.name}></if>" />
        <input type="hidden" name="SinaUserImgUrl" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.head}>/100<else/><{$baseinfo.profile_image_url}></if>" />
        <input type="hidden" name="SinaUserID" value="<if condition="$_SESSION['mbtype'] eq 'qq'"><{$baseinfo.data.name}><else/><{$baseinfo.id}></if>" />
        <input type="hidden" name="SinaUserAbout" value="" />
        <div class="APItem"><div class="Itemleft">用户名</div><div class="ItemRight"><input class="apitext" name="BindUName" id="BindUName" maxlength="25" type="text" /></div></div>
        <div class="APItem"><div class="Itemleft">密码</div><div class="ItemRight"><input class="apitext" name="BindPwd" maxlength="16" id="BindPwd" type="password" /></div></div>
        <div class="APItem"><div class="Itemleft"></div><div class="ItemRight"><input type="submit" value="" style=" background:url(<{:__PUBLIC__}>/images/sinaapi.jpg); background-position:0 40px; border:none; width:152px; height:40px; cursor:pointer;" /></div></div>
        </form>
    </div>
    <div style=" clear:both; height:60px;">&nbsp;</div>
	</div>
<script type="text/javascript">

$("#username").keyup(function(){

    $('#username').val($('#username').val().replace(/[\s\.]/ig,""));

    $('#wbadd').html($('#username').val());

    $('#username').val($('#username').val().slice(0,12));

    $('#wbadd').html($('#username').val().slice(0,12));

});

$("#mailadres").keyup(function() {$('#mailadres').val($('#mailadres').val().replace(/\s/ig,""));});

$("#password1").keyup(function() {$('#password1').val($('#password1').val().replace(/\s/ig,""));});

$("#password2").keyup(function() {$('#password2').val($('#password2').val().replace(/\s/ig,""));});



$('#invitecode').blur(function(){

    checkpost({action:'checkcode',invitecode:$('#invitecode').val()},0);

});

$('#username').blur(function(){

    checkpost({action:'checkname',uname:$('#username').val()},1);

});

$('#mailadres').blur(function(){

    checkpost({action:'checkmail',mail:$('#mailadres').val()},2);

});

$('#password1').blur(function(){

    checkpost({action:'checkpass1',pass1:$('#password1').val()},3);

});

$('#password2').blur(function(){

    checkpost({action:'checkpass2',pass1:$('#password1').val(),pass2:$('#password2').val()},4);

});

function checkpost(parse,id){

    $.post(siteurl+"/Index/regcheckstep",parse,

    function(msg){

        if (msg=="check_ok") {

            $('#check'+id).html('<div style="margin-top:5px"><img src="'+pubdir+'/images/signup-right.png"></div>');

        } else {

            $('#check'+id).html('<div class="errormt"><img src="'+pubdir+'/images/signup-wrong.png"> '+msg+'</div>');

        }

    });

}

function check_register(){

    checkpost({action:'checkcode',invitecode:$('#invitecode').val()},0);

    checkpost({action:'checkname',uname:$('#username').val()},1);

    checkpost({action:'checkmail',mail:$('#mailadres').val()},2);

    checkpost({action:'checkpass1',pass1:$('#password1').val()},3);

    checkpost({action:'checkpass2',pass1:$('#password1').val(),pass2:$('#password2').val()},4);

    check_register_ok();

}

function check_register_ok() {

    var t0=$('#invitecode').val();

    var t1=$('#username').val();

    var t2=$('#mailadres').val();

    var t3=$('#password1').val();

    var t4=$('#password2').val();

    var t5=$('#inviteuid').val();
    
    var mbid = $("#SinaUserID").val();
    var mbname = $("#SinaUserName").val();
    var mburl = $("#SinaUserImgUrl").val();
    var mbabout = $("#SinaUserAbout").val();

    $.post(siteurl+"/Index/regbindweibo",{invitecode:t0,uname:t1,mail:t2,pass1:t3,pass2:t4,inviteuid:t5, SinaUserName:mbname, SinaUserID:mbid, SinaUserImgUrl:mburl, SinaUserAbout:mbabout, timeout:new Date()},

    function(msg){

        if (msg=="check_ok") {

           $('#btn-reg').removeAttr('onclick');

           ye_dialog.openHtml("<div class='regok'>"+langjs['reg_success_rj']+"</div>",langjs['reg_new'],400,100);

           setInterval(function(){window.location.href=siteurl+'/Setting';}, 3000);

        }

    });

}

</script>
	
<include file="Common:foot" />